# -*- coding: utf-8 -*-
"""
author:码同学 极光
date:2023/10/22
desc: 
sample: 
"""
#左开右闭  从左到右 默认升序
name = "testfan"
#print(name[2:5]) #stf
#print(name[5:2])# 没有数据
#print(name[-5:-2])  #s..a stf
# print(name[-2:-5]) #没有数据
#
# #第三位是负数 降序
# print(name[-2:-5:-1]) #a。。s
# print(name[5:2:-1])#a..s

#缺省结尾特殊
print(name[:5])  #t..a testf
print(name[5:])  #an #默认结尾时候不参与闭合
print(name[:-1]) #开头 结尾 t...n testfa
print(name[::-1])

#循环应用 0.。。9
for i in range(10,1,-1):
    print(i)

data_list = ['极光', 'zhangsan', '李四', 'mtx', '王五']
print(data_list[0:3])